# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
  desc "ZWManagerLib 使用这个航道，可以快速对自己的私有库进行升级维护"
  lane :ZWManagerLib do |options|

  tagName = options[:tag]
  targetName = options[:target]

  # 1. pod install
    cocoapods(
        clean: true,
        podfile: "./Example/Podfile"
    )

  # 2. git add .
    git_add(path: ".")

  # 3. git commit -m "描述"
    git_commit(path: ".", message: "这里是更新版本信息")

  # 4. git push origin master
    push_to_git_remote

  # 5. git tag 标签名称
    add_git_tag(
        tag: tagName
    )

  # 6. git push --tags
    push_git_tags

  # 7. pod spec lint
    pod_lib_lint(allow_warnings: true)

  # 8. pod repo push XXXX xxx.spec
pod_push(path: "#{targetName}.podspec", repo: "ZWCocoapods")
  end
end
